package com.letian.info.service.impl;

import java.util.List;
import com.letian.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.letian.info.mapper.InfoVideoMapper;
import com.letian.info.domain.InfoVideo;
import com.letian.info.service.IInfoVideoService;

/**
 * 视频信息Service业务层处理
 * 
 * @author bmz
 * @date 2023-12-01
 */
@Service
public class InfoVideoServiceImpl implements IInfoVideoService 
{
    @Autowired
    private InfoVideoMapper infoVideoMapper;

    /**
     * 查询视频信息
     * 
     * @param videoId 视频信息主键
     * @return 视频信息
     */
    @Override
    public InfoVideo selectInfoVideoByVideoId(Long videoId)
    {
        return infoVideoMapper.selectInfoVideoByVideoId(videoId);
    }

    /**
     * 查询视频信息列表
     * 
     * @param infoVideo 视频信息
     * @return 视频信息
     */
    @Override
    public List<InfoVideo> selectInfoVideoList(InfoVideo infoVideo)
    {
        return infoVideoMapper.selectInfoVideoList(infoVideo);
    }

    /**
     * 新增视频信息
     * 
     * @param infoVideo 视频信息
     * @return 结果
     */
    @Override
    public int insertInfoVideo(InfoVideo infoVideo)
    {
        infoVideo.setCreateTime(DateUtils.getNowDate());
        return infoVideoMapper.insertInfoVideo(infoVideo);
    }

    /**
     * 修改视频信息
     * 
     * @param infoVideo 视频信息
     * @return 结果
     */
    @Override
    public int updateInfoVideo(InfoVideo infoVideo)
    {
        infoVideo.setUpdateTime(DateUtils.getNowDate());
        return infoVideoMapper.updateInfoVideo(infoVideo);
    }

    /**
     * 批量删除视频信息
     * 
     * @param videoIds 需要删除的视频信息主键
     * @return 结果
     */
    @Override
    public int deleteInfoVideoByVideoIds(Long[] videoIds)
    {
        return infoVideoMapper.deleteInfoVideoByVideoIds(videoIds);
    }

    /**
     * 删除视频信息信息
     * 
     * @param videoId 视频信息主键
     * @return 结果
     */
    @Override
    public int deleteInfoVideoByVideoId(Long videoId)
    {
        return infoVideoMapper.deleteInfoVideoByVideoId(videoId);
    }
}
